<%--                                                                       --%>
<%-- Copyright (c) 2001-2004 BroadVision, Inc.  All rights reserved.       --%>
<%--                                                                       --%>
<%-- This software is copyrighted. Under the copyright laws, this software --%>
<%-- may not be copied, in whole or in part, without prior written consent --%>
<%-- of BroadVision, Inc. or its assignees. This software is provided      --%>
<%-- under the terms of a license between BroadVision and the recipient,   --%>
<%-- and its use is subject to the terms of that license.                  --%>
<%--                                                                       --%>
<%-- This software may be protected by one or more U.S. and International  --%>
<%-- patents.  Certain applications of BroadVision One-To-One software are --%>
<%-- covered by U.S. patent 5,710,887.                                     --%>
<%--                                                                       --%>
<%-- TRADEMARKS: BroadVision and BroadVision One-To-One are registered     --%>
<%-- trademarks of BroadVision, Inc., in the United States and the         --%>
<%-- European Community, and are trademarks of BroadVision, Inc., in other --%>
<%-- countries.  The BroadVision logo, is a trademark of BroadVision,      --%>
<%-- Inc., in the United States and other countries.                       --%>
<%--                                                                       --%>

<%@ page language="java" %>

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> 
<%@ taglib uri="/WEB-INF/bv-html.tld" prefix="bvhtml" %>

<script language="javascript">

function openwin(file) {
  var win = window.open(file , "NewWindow", 'toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=yes,width=450,height=338');
  win.focus();
}

function confirmDeleteTask(theForm, url) {
   if (confirm("<bean:message key="cs.checklist.confirmDeleteTask"/>")) {
     theForm.action=url;
     theForm.submit();
   }
   else {
     return false;
   }
}

function clickMark(theForm, url) { 
  theForm.action = url;
  theForm.submit();
}
</script>

<!-- Zone 5 starts here.  -->
<table class="zoneFive" width="100%" border="0" cellspacing="0" cellpadding="0" 
       summary="content area">
  <tr>
    <td valign="top">
    
    <!--start microsite logo and name here-->
      <div class="pageTitle">
        <%@ include file="/cs/microsite/micrositeNaviInfo.jsp" %>
      </div> 
    <!--end microsite logo and name here-->

    <div class="pageSubtitle">
      <span class="left">        
         <bean:define id="taskViewName" name="taskView" property="name"/>      
		           <%String taskName = taskViewName.toString();%>
            <bean:message key="cs.view" arg0="<%=taskName %>"/>              
      </span>

      <logic:notEqual name="taskView" property="isReadOnly" value="true">
      <span class="right">
        <html:form action="/cs/checklistTaskEdit.do">
        <bvhtml:hiddenList name="micrositeNaviInfoView" property="urlParams" scope="request"/>
        <logic:equal name="taskView" property="owner" value="true">
          <logic:equal name="taskView" property="completed" value="false">
            <input type="button" class="titleButton" name="markCompleteBtn"
                 value='<bean:message key="button.mark"/>'
                 titleKey="button.mark" 
                 onclick="clickMark(this.form, '<html:rewrite page="/cs/checklistTaskMarkAsComplete.do"/>')">
            <%-- cannot add request parameter to rewrite tag above since it
                 will be ignored by the IM for HTML form submission --%>
            <input type=hidden name='markAction' value='markAsComplete' >
            <input type=hidden name='fromPage' value='view' >
          </logic:equal>
          <logic:equal name="taskView" property="completed" value="true">
            <input type="button" class="titleButton" name="markCompleteBtn"
                 value='<bean:message key="button.markInComplete"/>'
                 titleKey="button.markInComplete" 
                 onclick="clickMark(this.form, '<html:rewrite page="/cs/checklistTaskMarkAsComplete.do"/>')">
            <%-- cannot add request parameter to rewrite tag above since it
                 will be ignored by the IM for HTML form submission --%>
            <input type=hidden name='markAction' value='markAsIncomplete' >
            <input type=hidden name='fromPage' value='view' >
          </logic:equal>
          <input type="submit" class="titleButton" name="editBtn"
                 value='<bean:message key="button.edit"/>'
                 titleKey="button.edit">
                 
          <input type="button" class="titleButton" name="deleteBtn"
                 value='<bean:message key="button.delete"/>'
                 titleKey="button.delete"
                 onclick="confirmDeleteTask(this.form, '<html:rewrite page="/cs/checklistTaskDelete.do"/>')">
        </logic:equal>
        </html:form>
      </span>
      </logic:notEqual>
    </div> 
    <!--end page title area here-->

   <div class="blockWrap">

<!--start main content area here-->
   <table class="labelForm" width="100%" border="0" cellspacing="0" 
           cellpadding="3" summary="Task Information">
           
   <tr> 
    <td nowrap width="20%" class="label"> 
      <bean:message key="cs.description"/> : 
    </td>
    <td width="80%" class="labelField">
      <bean:write name="taskView" property="description"/>&nbsp;
    </td>
  </tr>
  </tr>
  <logic:equal name="micrositeNaviInfoView" property="micrositeTemplatePhaseFlag" value="true" >
  <tr> 
    <td nowrap width="20%" class="label"> 
      <bean:message key="cs.phase"/> : 
    </td>
    <td width="80%" class="labelField">
    <bean:write name="taskView" property="phaseName"/>&nbsp;
    </td>
  </tr>
  </logic:equal>
  <tr>  
    <td nowrap width="20%" class="label">
      <bean:message key="cs.owner"/> :
    </td>
    <td width="80%" nowrap class="labelField">
    <bean:write name="taskView" property="ownerName"/>&nbsp;
    </td>
  </tr>
  <tr>  
    <td nowrap width="20%" class="label">
      <bean:message key="cs.priority"/> :
    </td>
    <td width="80%" nowrap class="labelField">
        <logic:equal name="taskView" property="priority" value="0">
        <bean:message key="cs.high"/>
        </logic:equal>
        <logic:equal name="taskView" property="priority" value="1">
        <bean:message key="cs.medium"/>
        </logic:equal>
        <logic:equal name="taskView" property="priority" value="2">
        <bean:message key="cs.low"/>
        </logic:equal>
      </td>
    </tr>
    <tr>  
      <td nowrap width="20%" class="label">
        <bean:message key="cs.tasks.startDate"/> :
      </td>
      <td width="80%" nowrap class="labelField">
        <bean:write name="taskView" property="startDate" formatKey="format.datetime.tasklist" filter="false" />&nbsp;
      </td>
    </tr>
      
    <tr>  
      <td nowrap width="20%" class="label">
        <bean:message key="cs.tasks.dueDate"/> :
      </td>
      <td width="80%" nowrap class="labelField">
        <bean:write name="taskView" property="dueDate" formatKey="format.datetime.tasklist" filter="false" />&nbsp;
      </td>
    </tr>
    <tr>  
        <td nowrap width="20%" class="label">
          <bean:message key="cs.tasks.completionDate"/> :
        </td>
        <td width="80%" nowrap class="labelField">
         <logic:equal name="taskView" property="completed" value="true">
          <bean:write name="taskView" property="completionDate" formatKey="format.datetime.tasklist" filter="false" />
         </logic:equal>&nbsp;
        </td>
      </tr>
      
  <logic:greaterThan name="taskView" property="checklistId" value="0" >
    <tr> 
      <td nowrap width="20%" class="label"><bean:message key="cs.status"/> :</td>
      <td width="80%" class="labelField">
      <logic:equal name="taskView" property="taskStatus" value="0">
       <bean:message key="cs.status.assigned"/> 
      </logic:equal>
      <logic:equal name="taskView" property="taskStatus" value="1">
      <bean:message key="cs.status.pending"/> 
      </logic:equal>
      <logic:equal name="taskView" property="taskStatus" value="2">
      <bean:message key="cs.status.completed"/> 
      </logic:equal>
      <logic:equal name="taskView" property="taskStatus" value="3">
      <bean:message key="cs.status.active"/> 
      </logic:equal>
      <logic:equal name="taskView" property="taskStatus" value="4">
      <bean:message key="cs.status.deferred"/> 
      </logic:equal>
      </td>
    </tr>
  </logic:greaterThan>
  <%-- // Need to define the attachment form bean for the included JSP --%>
  </table>
  
<!-- Attachment list begins. -->
    <bean:define id="beanUsed" name="taskView" toScope="request" />
    <%@ include file="/cs/microsite/attachment/attachmentView.jsp" %>
    <!-- Attachment list ends. -->
    
   </div> 
    
  </td>
 </tr> 
</table>

<!--end main content area here-->

